package Algorithm.Tree;

import Algorithm.LinkedListProblem.relocate;

/**
 * @Author cj
 * @Date 2022/1/13 20:55
 */
public class orderRecur {

    static class Node {
        public int value;
        public Node left;
        public Node right;

        public Node(int val) {
            this.value = val;
        }
    }

    public static void preOrderRecur(Node root) {
        if (root == null) {
            return;
        }
        System.out.println("value is " + root.value);
        preOrderRecur(root.left);
        preOrderRecur(root.right);
    }

    public static void inOrderRecur(Node root) {
        if (root == null) {
            return;
        }
        inOrderRecur(root.left);
        System.out.println("value is " + root.value);
        inOrderRecur(root.right);
    }

    public static void posOrderRecur(Node root) {
        if (root == null) {
            return;
        }
        posOrderRecur(root.left);
        posOrderRecur(root.right);
        System.out.println("value is " + root.value);
    }

}
